const { exec } = require('../database/mysql');
const md5 = require('md5');

let postLogin = async (username, password) => {
    password = md5(password)
    let sql = `
    select username, realname
    from users
    where username = '${username}'
    and password = '${password}';
    `
    let rows = await exec(sql)
    return rows[0] || false
}

module.exports = {
    postLogin
}